<?php
ini_set('display_errors', 1);
error_reporting(-1);
ini_set('memory_limit', '2048M');
require_once '/data/wwwroot/g_vendor/autoload.php';


$uid = $argv[1] ?? 0;
$groupId = $argv[2] ?? 0;


$rs = \Doraemon\service\Task\Task::getTaskListByGroupId($uid, $groupId);
$taskList = $rs[$groupId]['task_list'] ?? [];
foreach ($taskList as $task) {
    $undo = $task['operate_num'] - $task['operated_num'] ?: 0;
    echo implode("\t", [$task['task_title'], $task['id'], $undo]), PHP_EOL;
}
